package com.refuel.controller;

import com.refuel.request.GoodsConfigRequest;
import com.refuel.request.GuideConfigRequest;
import com.refuel.request.HeadImageRequest;
import com.refuel.response.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhanghao
 * @description 商品后端配置器
 * @date 2024/5/9 16:08
 **/
@RestController
@RequestMapping("/config/goods")
@Tag(name = "商品配置控制器", description = "商品配置相关接口")
public class GoodsConfigController extends BaseController {

    private static final Logger logger = LoggerFactory.getLogger(GoodsConfigController.class);

    /**
     * 首页顶部头图配置
     * @return Response
     */
    @Operation(summary = "首页顶部轮播图配置接口")
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "成功"),
            @ApiResponse(responseCode = "400", description = "xx参数错误")
    })
    @RequestMapping(method = RequestMethod.POST, path = "/head/image/save")
    public Response guideSave(@RequestBody HeadImageRequest request) {
        logger.info("guide guideRequest: {}", request);

        return Response.buildResponse();
    }

    /**
     * 首页顶部下单说明配置
     * @return BaseResponse
     */
    @Operation(summary = "首页顶部下单说明配置接口")
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "成功"),
            @ApiResponse(responseCode = "400", description = "xx参数错误")
    })
    @RequestMapping(method = RequestMethod.POST, path = "/guide/save")
    public Response guideSave(@RequestBody GuideConfigRequest guideRequest) {
        logger.info("guide guideRequest: {}", guideRequest);
        return Response.buildResponse();
    }

    /**
     * 单个商品信息配置
     * @return BaseResponse
     */
    @Operation(summary = "单个商品信息配置接口")
    @ApiResponses({
            @ApiResponse(responseCode = "200", description = "成功"),
            @ApiResponse(responseCode = "400", description = "xx参数错误")
    })
    @RequestMapping(method = RequestMethod.POST, path = "/info/save")
    public Response goodsConfig(@RequestBody GoodsConfigRequest guideRequest) {
        logger.info("goodsConfig guideRequest: {}", guideRequest);

        return Response.buildResponse();
    }

}
